#include "Basket.h"
//#include <stdio.h>

Basket::Basket ()
{
	num_app = 0;
	index_bask = 0;
}

Basket::Basket (size_t index): index_bask(index)
{
	num_app = 0;
}

Basket::Basket (size_t index, size_t number)
{
	index_bask = index;
	num_app = number;
}

Basket::~Basket () {}

size_t Basket::get_num () const
{
	return num_app;
}

void Basket::set_num (size_t number)
{
	num_app = number;
}

size_t Basket::get_index () const
{
	return index_bask;
}

void Basket::set_index (size_t value)
{
	index_bask = value;
}

/*
Comparator for field *num_app* Basket's class
Basket a - the first operand to compare
Basket b - the second operand to compare
size_t variant:
			0 - strict comparison
			other - non-strict comparisons
*/
bool comparator_num_app::operator() (Basket* a, Basket* b, size_t variant) const
{
	if (variant == 0)
		return a->get_num() > b->get_num();
	else 
		return a->get_num() >= b->get_num();
}

/*
Comparator for field *index_bask* Basket's class
Basket a - the first operand to compare
Basket b - the second operand to compare
size_t variant:
			0 - strict comparison
			other - non-strict comparisons
*/
bool comparator_index_bask::operator () (Basket* a, Basket* b, size_t variant) const
{
	if (variant == 0)
		return a->get_index() > b->get_index();
	else
		return a->get_index() >= b->get_index();
}